<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="/inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<script type="text/javascript" src="${basepath}/res/js/plugin/ckeditor/ckeditor.js" charset="utf-8"></script>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
	$(document).ready(function() {
      	setNoPageBarDivHeight();
      	var _toolbar =      
							[      
							    ['Source','Bold','Italic','Underline'],      
							    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],      
							    ['Styles','FontSize'], 
							    ['Link','Unlink'],
							    ['Table'],     
							    ['TextColor']
							]; 
		  CKEDITOR.replace('describes',{width:'700',height:'250',uiColor:'#BFEFFF',skin:'office2003',language:'zh-cn',toolbar:_toolbar});
  	});
	function update(){
		if(!document.getElementById("name").value){
			jError("产品名称不能为空",null, function(r){
				document.getElementById("name").focus();
			});
			return false;
		}
		else if(!document.getElementById("pno").value){
			jError("产品编号不能为空",null, function(r){
				document.getElementById("pno").focus();
			});
			return false;
		}
		else if(!document.getElementById("volume").value){
			jError("产品规格不能为空",null, function(r){
				document.getElementById("volume").focus();
			});
			return false;
		}
		var oEditor = CKEDITOR.instances.describes;
		var describes = oEditor.getData();
		$("#describes").val(describes);
		var url="${basepath}/productgeneral?m=update";
		var options = {
			url: url,
			type: 'post',
			dataType: 'json',
			success: function(data){
				if(data!=null)
					jError(data.msg);
				else{
					jSuccess("修改成功!", null, function(r){
						location.href="${basepath}/productgeneral?m=search&channelId=${product.channelId}";
					});
	            }
			}
		};
		$("#productform").ajaxSubmit(options);
	}
</script>
</head>
<body>
  <form id="productform" name="productform" enctype="multipart/form-data" action="${basepath}/product?m=add">
  <input name="channelId" id="channelId" value="${product.channelId}" type="hidden">
  <input name="id" id="id" value="${product.id}" type="hidden">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  	<tr>
      <td height="30">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
        	<td height="24" bgcolor="#353c44">
        	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          	    <tr>
            	  <td>
            	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              		  <tr>
                	    <td width="2%" height="19" valign="bottom"><div align="center"><img src="${basepath}/res/image/tb.gif" width="14" height="14" /></div></td>
                	    <td width="98%" valign="bottom"><span class="STYLE1"> 修改产品</span></td>
              		  </tr>
            	    </table>
            	  </td>
          	    </tr>
        	  </table>
            </td>
      	  </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <div id="dataDiv" class="scrollDiv" >
      	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
       	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">产品名称：</td>
        	<td width="30%" bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="name" name="name" title="产品名称" value="${product.name}"><font color="red">&nbsp;*</font></td>
        	<td width="20%" height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">产品编号：</td>
        	<td width="30%" bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="pno" name="pno" title="产品编号" value="${product.pno}"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">产品材料：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="material" name="material" title="产品材料" value="${product.material}"><font color="red">&nbsp;*</font></td>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">产品规格：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="volume" name="volume" title="产品规格" value="${product.volume}"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">产品描述：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left" colspan="3">&nbsp;<textarea id="describes" name="describes" style="margin-top: 5px;margin-bottom: 5px;" title="产品信息">${product.describes}</textarea> </td>
      	  </tr>
      	  <tr>
        	<td height="100" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="center" colspan="4" id="idMsg"> 
        	  <img src="${basepath}/res/image/qd.jpg" width="59" height="22" onclick="update();" title="提交" style="cursor: pointer;">
        	  <img src="${basepath}/res/image/cz.jpg" width="59" height="22" onclick="productform.reset();" title="重置" style="cursor: pointer;">
        	</td>
      	  </tr>
  		</table>
  		</div>
  	  </td>
  	</tr>
  </table>
  </form>
</body>

